Skip to content

refactor: Consolidate duplicate queue category display constants between repos.ts and queue.ts#209

Open
frostyardyeti[bot] wants to merge 1 commit intomainfrom
yeti/improve-9cb7
Open

refactor: Consolidate duplicate queue category display constants between repos.ts and queue.ts#209
frostyardyeti[bot] wants to merge 1 commit intomainfrom
yeti/improve-9cb7

Conversation

@frostyardyeti
Copy link
Copy Markdown
Contributor

@frostyardyeti frostyardyeti Bot commented Apr 1, 2026

The queue category labels and colors are defined independently in two files:

  • src/pages/repos.ts:7-25 defines CATEGORY_LABELS and CATEGORY_COLORS as two separate Record<QueueCategory, string> constants
  • src/pages/queue.ts:5-13 defines CATEGORY_DISPLAY as a combined Record<QueueCategory, { label: string; color: string }>

Both contain identical data (same 7 categories, same labels, same hex colors). If a category is added or a color changes, both files must be updated in lockstep.

Extract a single CATEGORY_DISPLAY constant into src/pages/layout.ts (which already serves as the shared page utility module) and import it from both files. The combined { label, color } structure from queue.ts is the better shape since it co-locates related data.


Automated improvement by yeti improvement-identifier

… layout.ts

Extract CATEGORY_DISPLAY from queue.ts and the equivalent CATEGORY_LABELS/CATEGORY_COLORS
from repos.ts into a single shared constant in layout.ts, eliminating data duplication
that required lockstep updates across two files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant